import request from "utils/request";
import { deepClone } from "utils";
import {StringData} from "utils";

//定义接口地址
const URL = {
  "findUnique": `/occ-cmpt/cmpt/bill-flow-configs/find-unique`, //参照-查询列表
  "getbillbpm":"/eiap-plus/process/getbillbpm",
  "approve":"/eiap-plus/task/completetask/approveCard", //暂时不用 全靠配置
  "rejectapprove":"/eiap-plus/task/rejecttask/reject", //暂时不用 全靠配置
  "getHisTasklist":"/eiap-plus/process/hisTasklist",
  "processInstancediagram":"/eiap-plus/process/processInstancediagram",
  "highlightsprocessInstance":"/eiap-plus/process/highlightsprocessInstance"
};

export const getHisTasklist = param => {
    return request(URL.getHisTasklist, {
      method: "post",
      data: param,
      })
};

export const getProcessInstancediagram = param => {
    return request(URL.processInstancediagram, {
      method: "get",
      param: param,
      })
};

export const getHighlightsprocessInstance = param => {
    return request(URL.highlightsprocessInstance, {
      method: "get",
      param: param,
      })
};

export const getBillBpm = param => {
  let data = param.data;
  return request(URL.getbillbpm, {
    method: "post",
    data: data,
    })
};

export const getFindUnique = param => {
  let data = param.data;
    return request(URL.findUnique, {
      method: "get",
      param: data,
      })
  };

export const onSubmit = param => {
    let data = param.data;
    return request(param.url, {
      method: "post",
      param: param.param,
      data:data
      })
};

export const onCallback = param => {
  let data = param.data;
    return request(param.url, {
      method: "post",
      data: data,
    })
};

export const onApprove = param => {
  let data = param.data;
    return request(param.url, {
      method: "post",
      data: data,
    })
};

export const onCancelApprove = param => {
  let data = param.data;
    return request(param.url, {
      method: "post",
      data: data,
    })
};
